#ifndef _APPS_BDESKTOP_CAPPMANAGER_H_
#define _APPS_BDESKTOP_CAPPMANAGER_H_

#include "auto.h"
#include <unordered_map>
#include "capplication.h"
#include "cdock.h"

namespace buola { namespace bdesktop {

class CAppManager
{
public:
    CAppManager(CDock *pDock);
    ~CAppManager();

    CApplication *GetApplicationForType(os::CApplication *pType);
    CApplication *GetApplicationForClass(const std::string &pClass);

    void OnClientAdded(CClient *);

    CDock *GetDock()    {   return mDock;   }

    void OnDBusSignal(dbus::CMessage *pMessage);

private:
    CDock *mDock;
    std::unordered_map<std::string,CApplication*> mApplicationByClass;
    std::unordered_map<os::CApplication*,CApplication*> mApplicationByType;
};

/*namespace bdesktop*/ } /*namespace buola*/ }

#endif
